package com.ss.android.article.base.feature.detail2.a.c;

import com.ss.android.article.browser.R;
import com.ss.android.common.download.DownloadShortInfo;
import com.ss.android.common.util.ToolUtils;

final class n implements Runnable {
    private final DetailAdSmallPicLayout e;
    private final long a;
    private final long b;
    private final int c;
    private final DownloadShortInfo d;

    n(DetailAdSmallPicLayout arg1, long arg2, long arg4, int arg6, DownloadShortInfo arg7) {
        this.e = arg1;
        this.a = arg2;
        this.b = arg4;
        this.c = arg6;
        this.d = arg7;

    }

    public final void run() {
        int v8 = R.string.detail_appad_smallpic_source_downloading;
        String v1 = "";
        String v0 = this.e.getContext().getString(v8, new Object[]{Integer.valueOf(0)});
        int v2 = ((int)((((double)this.a)) / (((double)this.b)) * 100));
        if(this.c == 1) {
            v1 = this.e.getContext().getString(com.ss.android.article.browser.R.string.detail_appad_smallpic_pause);
            v0 = this.e.getContext().getString(v8, new Object[]{Integer.valueOf(v2)});
        }
        else if(this.c == 2) {
            v1 = this.e.getContext().getString(com.ss.android.article.browser.R.string.ki);
            v0 = this.e.getContext().getString(com.ss.android.article.browser.R.string.detail_appad_smallpic_source_pausing, new Object[]{Integer.valueOf(v2)});
        }
        else if(this.c == 3) {
            if(this.d.b == 16) {
                v1 = this.e.getContext().getString(com.ss.android.article.browser.R.string.kh);
                v0 = this.e.getContext().getString(com.ss.android.article.browser.R.string.detail_appad_smallpic_download_failed);
            }
            else if(this.d.b == 8) {
                v0 = ToolUtils.isAppInstalled(this.e.getContext(), this.e.e) ? this.e.getContext().getString(com.ss.android.article.browser.R.string.ke) : this.e.getContext().getString(com.ss.android.article.browser.R.string.k9);
                v1 = v0;
                v0 = this.e.b;
            }
        }

        this.e.a.setText(((CharSequence)v0));
        this.e.c.setText(((CharSequence)v1));
    }
}

